Optimal. Leaf size=110 \[ 4 a^3 (A-i B) x-\frac {4 a^3 (i A+B) \log (\cos (e+f x))}{f}-\frac {2 a^3 (A-i B) \tan (e+f x)}{f}+\frac {a (i A+B) (a+i a \tan (e+f x))^2}{2 f}+\frac {B (a+i a \tan (e+f x))^3}{3 f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 110, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3608, 3559,
3558, 3556} \begin {gather*} -\frac {2 a^3 (A-i B) \tan (e+f x)}{f}-\frac {4 a^3 (B+i A) \log (\cos (e+f x))}{f}+4 a^3 x (A-i B)+\frac {a (B+i A) (a+i a \tan (e+f x))^2}{2 f}+\frac {B (a+i a \tan (e+f x))^3}{3 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3556
Rule 3558
Rule 3559
Rule 3608
Rubi steps
\begin {align*} \int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) \, dx &=\frac {B (a+i a \tan (e+f x))^3}{3 f}-(-A+i B) \int (a+i a \tan (e+f x))^3 \, dx\\ &=\frac {a (i A+B) (a+i a \tan (e+f x))^2}{2 f}+\frac {B (a+i a \tan (e+f x))^3}{3 f}+(2 a (A-i B)) \int (a+i a \tan (e+f x))^2 \, dx\\ &=4 a^3 (A-i B) x-\frac {2 a^3 (A-i B) \tan (e+f x)}{f}+\frac {a (i A+B) (a+i a \tan (e+f x))^2}{2 f}+\frac {B (a+i a \tan (e+f x))^3}{3 f}+\left (4 a^3 (i A+B)\right ) \int \tan (e+f x) \, dx\\ &=4 a^3 (A-i B) x-\frac {4 a^3 (i A+B) \log (\cos (e+f x))}{f}-\frac {2 a^3 (A-i B) \tan (e+f x)}{f}+\frac {a (i A+B) (a+i a \tan (e+f x))^2}{2 f}+\frac {B (a+i a \tan (e+f x))^3}{3 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(331\) vs. \(2(110)=220\).
time = 2.03, size = 331, normalized size = 3.01 \begin {gather*} \frac {a^3 \sec (e) \sec ^3(e+f x) \left (6 A f x \cos (2 e+3 f x)-6 i B f x \cos (2 e+3 f x)+6 A f x \cos (4 e+3 f x)-6 i B f x \cos (4 e+3 f x)-3 i A \cos (2 e+3 f x) \log \left (\cos ^2(e+f x)\right )-3 B \cos (2 e+3 f x) \log \left (\cos ^2(e+f x)\right )-3 i A \cos (4 e+3 f x) \log \left (\cos ^2(e+f x)\right )-3 B \cos (4 e+3 f x) \log \left (\cos ^2(e+f x)\right )+3 \cos (f x) \left (-i A-3 B+6 A f x-6 i B f x+(-3 i A-3 B) \log \left (\cos ^2(e+f x)\right )\right )+3 \cos (2 e+f x) \left (-i A-3 B+6 A f x-6 i B f x+(-3 i A-3 B) \log \left (\cos ^2(e+f x)\right )\right )-18 A \sin (f x)+24 i B \sin (f x)+9 A \sin (2 e+f x)-15 i B \sin (2 e+f x)-9 A \sin (2 e+3 f x)+13 i B \sin (2 e+3 f x)\right )}{12 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.11, size = 100, normalized size = 0.91
method | result | size |
derivativedivides | \(\frac {a^{3} \left (-\frac {i B \left (\tan ^{3}\left (f x +e \right )\right )}{3}-\frac {i A \left (\tan ^{2}\left (f x +e \right )\right )}{2}+4 i B \tan \left (f x +e \right )-\frac {3 B \left (\tan ^{2}\left (f x +e \right )\right )}{2}-3 A \tan \left (f x +e \right )+\frac {\left (4 i A +4 B \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (-4 i B +4 A \right ) \arctan \left (\tan \left (f x +e \right )\right )\right )}{f}\) | \(100\) |
default | \(\frac {a^{3} \left (-\frac {i B \left (\tan ^{3}\left (f x +e \right )\right )}{3}-\frac {i A \left (\tan ^{2}\left (f x +e \right )\right )}{2}+4 i B \tan \left (f x +e \right )-\frac {3 B \left (\tan ^{2}\left (f x +e \right )\right )}{2}-3 A \tan \left (f x +e \right )+\frac {\left (4 i A +4 B \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (-4 i B +4 A \right ) \arctan \left (\tan \left (f x +e \right )\right )\right )}{f}\) | \(100\) |
norman | \(\left (-4 i B \,a^{3}+4 A \,a^{3}\right ) x -\frac {\left (i A \,a^{3}+3 B \,a^{3}\right ) \left (\tan ^{2}\left (f x +e \right )\right )}{2 f}-\frac {\left (-4 i B \,a^{3}+3 A \,a^{3}\right ) \tan \left (f x +e \right )}{f}-\frac {i B \,a^{3} \left (\tan ^{3}\left (f x +e \right )\right )}{3 f}+\frac {2 \left (i A \,a^{3}+B \,a^{3}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{f}\) | \(117\) |
risch | \(\frac {8 i a^{3} B e}{f}-\frac {8 a^{3} A e}{f}-\frac {2 a^{3} \left (12 i A \,{\mathrm e}^{4 i \left (f x +e \right )}+24 B \,{\mathrm e}^{4 i \left (f x +e \right )}+21 i A \,{\mathrm e}^{2 i \left (f x +e \right )}+33 B \,{\mathrm e}^{2 i \left (f x +e \right )}+9 i A +13 B \right )}{3 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{3}}-\frac {4 a^{3} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) B}{f}-\frac {4 i a^{3} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) A}{f}\) | \(145\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.50, size = 101, normalized size = 0.92 \begin {gather*} -\frac {2 i \, B a^{3} \tan \left (f x + e\right )^{3} + 3 \, {\left (i \, A + 3 \, B\right )} a^{3} \tan \left (f x + e\right )^{2} - 24 \, {\left (f x + e\right )} {\left (A - i \, B\right )} a^{3} + 12 \, {\left (-i \, A - B\right )} a^{3} \log \left (\tan \left (f x + e\right )^{2} + 1\right ) + 6 \, {\left (3 \, A - 4 i \, B\right )} a^{3} \tan \left (f x + e\right )}{6 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 6.68, size = 184, normalized size = 1.67 \begin {gather*} -\frac {2 \, {\left (12 \, {\left (i \, A + 2 \, B\right )} a^{3} e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, {\left (7 i \, A + 11 \, B\right )} a^{3} e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (9 i \, A + 13 \, B\right )} a^{3} + 6 \, {\left ({\left (i \, A + B\right )} a^{3} e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, {\left (i \, A + B\right )} a^{3} e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, {\left (i \, A + B\right )} a^{3} e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (i \, A + B\right )} a^{3}\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )\right )}}{3 \, {\left (f e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.38, size = 184, normalized size = 1.67 \begin {gather*} - \frac {4 i a^{3} \left (A - i B\right ) \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{f} + \frac {- 18 i A a^{3} - 26 B a^{3} + \left (- 42 i A a^{3} e^{2 i e} - 66 B a^{3} e^{2 i e}\right ) e^{2 i f x} + \left (- 24 i A a^{3} e^{4 i e} - 48 B a^{3} e^{4 i e}\right ) e^{4 i f x}}{3 f e^{6 i e} e^{6 i f x} + 9 f e^{4 i e} e^{4 i f x} + 9 f e^{2 i e} e^{2 i f x} + 3 f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 333 vs. \(2 (98) = 196\).
time = 0.65, size = 333, normalized size = 3.03 \begin {gather*} -\frac {2 \, {\left (6 i \, A a^{3} e^{\left (6 i \, f x + 6 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 6 \, B a^{3} e^{\left (6 i \, f x + 6 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 18 i \, A a^{3} e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 18 \, B a^{3} e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 18 i \, A a^{3} e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 18 \, B a^{3} e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 12 i \, A a^{3} e^{\left (4 i \, f x + 4 i \, e\right )} + 24 \, B a^{3} e^{\left (4 i \, f x + 4 i \, e\right )} + 21 i \, A a^{3} e^{\left (2 i \, f x + 2 i \, e\right )} + 33 \, B a^{3} e^{\left (2 i \, f x + 2 i \, e\right )} + 6 i \, A a^{3} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 6 \, B a^{3} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 9 i \, A a^{3} + 13 \, B a^{3}\right )}}{3 \, {\left (f e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 8.91, size = 125, normalized size = 1.14 \begin {gather*} -\frac {{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {B\,a^3}{2}+\frac {a^3\,\left (2\,B+A\,1{}\mathrm {i}\right )}{2}\right )}{f}+\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (4\,B\,a^3+A\,a^3\,4{}\mathrm {i}\right )}{f}+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (B\,a^3\,1{}\mathrm {i}-a^3\,\left (2\,A-B\,1{}\mathrm {i}\right )+a^3\,\left (2\,B+A\,1{}\mathrm {i}\right )\,1{}\mathrm {i}\right )}{f}-\frac {B\,a^3\,{\mathrm {tan}\left (e+f\,x\right )}^3\,1{}\mathrm {i}}{3\,f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________